﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;

namespace ggprot
{
    class GGTypingNotify: GGHeader
    {
        private short type;
        private int uin;

        public int Uin
        {
            get { return uin; }
            set { uin = value; }
        }

        public short NotifType
        {
            get { return type; }
            set { type = value; }
        }

        public GGTypingNotify(GGHeader header)
        {
            this.Type = header.Type;
            this.Length = header.Length;
        }

        public GGTypingNotify() { }

        public override void Write(NetworkStream stream)
        {
            base.Write(stream);

            BinaryWriter writer = new BinaryWriter(stream);
            writer.Write(type);
            writer.Write(uin);
        }

        public override void Read(NetworkStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            type = reader.ReadInt16();
            uin = reader.ReadInt32();
        }
    }
}
